/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙，邂逅框架梦，本文采用木兰宽松许可证第2版]
 * 
 * https://zhiqim.org/project/zhiqim_kit/zhiqim_git.htm
 *
 * ZhiqimGit is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
package org.zhiqim.git.constants;

import org.zhiqim.kernel.util.Bytes;


/**
 * Git流常量定义
 *
 * @version v1.0.0 @author zhichenggang 2014-3-21 新建与整理
 */
public interface GitStreamConstants
{
    /** 缓冲大小 */
    public static final int BUFFER_SIZE                         = 8192;//默认的缓存大小
    
    /** 包头长度 */
    public static final int PACK_HEADER_LEN                     = 12;//PACK+版本号+对象数
    
    /** 包版本号*/
    public static final int PACK_VERSION_GENERATED              = 2;//用于Git 1.6及以后的版本
    
    /** 包标志 */
    public static final byte[] PACK_SIGNATURE                   = {'P', 'A', 'C', 'K'};
    
    /** 流段落结束标志 */
    public static final byte[] END                              = {'0', '0', '0', '0'};
    
    /** 包索引文件头标志tOc */
    public static final byte[] TOC                              = {-1, 't', 'O', 'c'};
    
    /*****************************************************************************************************************/
    //边频带
    /*****************************************************************************************************************/
    
    /** 边频带头部长度4+1 */
    public static final int SB_HDR_SIZE                         = 5;
    
    /** 边频带最小缓存 side-band */
    public static final int SB_MIN_BUF                          = 1000;
    
    /** 边频带最大缓存 side-band-64k */
    public static final int SB_MAX_BUF                          = 65520;
    
    /** 边频带数据标志 */
    public static final int SB_CH_DATA                          = 1;
    
    /** 边频带进度标志 */
    public static final int SB_CH_PROGRESS                      = 2;
    
    /** 边频带错误标志 */
    public static final int SB_CH_ERROR                         = 3;
    
    /*****************************************************************************************************************/
    //消息头
    /*****************************************************************************************************************/
    
    /** tree前缀 */
    public static final byte[] P_TREE                           = Bytes.toBytesASCII("tree ");

    /** parent前缀 */
    public static final byte[] P_PARENT                         = Bytes.toBytesASCII("parent ");

    /** author前缀 */
    public static final byte[] P_AUTHOR                         = Bytes.toBytesASCII("author ");

    /** committer前缀 */
    public static final byte[] P_COMMITTER                      = Bytes.toBytesASCII("committer ");

    /** encoding前缀 */
    public static final byte[] P_ENCODING                       = Bytes.toBytesASCII("encoding ");

    /** object前缀 */
    public static final byte[] P_OBJECT                         = Bytes.toBytesASCII("object ");

    /** type前缀 */
    public static final byte[] P_TYPE                           = Bytes.toBytesASCII("type ");

    /** tag前缀 */
    public static final byte[] P_TAG                            = Bytes.toBytesASCII("tag ");

    /** tagger前缀 */
    public static final byte[] P_TAGGER                         = Bytes.toBytesASCII("tagger ");
    
    /*****************************************************************************************************************/
    //文件头
    /*****************************************************************************************************************/
    
    public static final byte[] OLD_MODE                         = Bytes.toBytesASCII("old mode ");

    public static final byte[] NEW_MODE                         = Bytes.toBytesASCII("new mode ");

    public static final byte[] DELETED_FILE_MODE                = Bytes.toBytesASCII("deleted file mode ");

    public static final byte[] NEW_FILE_MODE                    = Bytes.toBytesASCII("new file mode ");

    public static final byte[] COPY_FROM                        = Bytes.toBytesASCII("copy from ");

    public static final byte[] COPY_TO                          = Bytes.toBytesASCII("copy to ");

    public static final byte[] RENAME_OLD                       = Bytes.toBytesASCII("rename old ");

    public static final byte[] RENAME_NEW                       = Bytes.toBytesASCII("rename new ");

    public static final byte[] RENAME_FROM                      = Bytes.toBytesASCII("rename from ");

    public static final byte[] RENAME_TO                        = Bytes.toBytesASCII("rename to ");

    public static final byte[] SIMILARITY_INDEX                 = Bytes.toBytesASCII("similarity index ");

    public static final byte[] DISSIMILARITY_INDEX              = Bytes.toBytesASCII("dissimilarity index ");

    public static final byte[] INDEX                            = Bytes.toBytesASCII("index ");

    public static final byte[] OLD_NAME                         = Bytes.toBytesASCII("--- ");

    public static final byte[] NEW_NAME                         = Bytes.toBytesASCII("+++ ");
}
